////////////////////////////////////////////////////////////////////////////////
//
//  FLYING KIWI BV
//  Copyright 2010 Flying Kiwi BV
//  All Rights Reserved.
//
//  NOTICE: Flying Kiwi permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package plantool.display.windows.objects {
	//--------------------------------------------------------------------------
	//  Imports
	//--------------------------------------------------------------------------
	import flash.display.GradientType;
	import flash.geom.Matrix;
	
	import plantool.display.windows.BaseWindow;
	import plantool.display.windows.objects.WindowRow;

	//--------------------------------------------------------------------------
	//  [Metadata (Events, Style, Effects etc)]
	//--------------------------------------------------------------------------
	
	//--------------------------------------------------------------------------
	//  Class declaration
	//--------------------------------------------------------------------------
	public class WindowRowSeparator extends WindowRow {
		//--------------------------------------------------------------------------
		//Class constants
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//Class variables
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//Class properties
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//Constructor and Destructor
		//--------------------------------------------------------------------------
		public function WindowRowSeparator(window:BaseWindow) {
			//call super
			super(window);
			
			//set new height
			height 	= 10;
			width	= window.width;
		}
		
		//--------------------------------------------------------------------------
		//Class methods
		//--------------------------------------------------------------------------
		public override function draw():void {
			//create button graphics
			graphics.clear();
			graphics.beginFill(0);
			graphics.drawRect(0, 0, width, height);
			graphics.endFill();
			
			var myMatrix:Matrix = new Matrix();
			myMatrix.createGradientBox(width, height, Math.PI / 2, 0, 0);
			var colors:Array = [0xFFFFFF, 0xAAAAAA];
			var alphas:Array = [0.2, 0.25];
			var ratios:Array = [0, 255];
			
			graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, myMatrix);
			graphics.drawRect(0, 0, width, height);
			graphics.endFill();
		}
	}
}